# -*- coding: utf-8 -*-

import pickle
import numpy as np
import pandas as pd
import csv

if __name__ == '__main__':
    ups = pickle.load(file=open(file='../PickledFile/uploader.pickled', mode='rb'))  # type: pd.DataFrame
    vid = pickle.load(file=open(file='../PickledFile/video.pickled', mode='rb'))  # type: pd.DataFrame
    dms = pickle.load(file=open(file='../PickledFile/dm.pickled', mode='rb'))  # type: pd.DataFrame
    cts = pickle.load(file=open(file='../PickledFile/comments.pickled', mode='rb'))  # type: pd.DataFrame

    dms_sample = dms.sample(n=500)
    cts_sample = cts.sample(n=500)

    # file_dm = csv.writer(open(file='./弹幕sample2.csv', encoding='utf-8', mode='w', newline=''))
    # file_ct = csv.writer(open(file='调侃鼓励严肃/评论sample.csv', encoding='utf-8', mode='w', newline=''))
    #
    # for i in dms_sample['content']:
    #     print(i)
    #     file_dm.writerow([i, 0])
    #
    # for i in cts_sample['content'].values:
    #     print(i)
    #     file_ct.writerow([i, 0])
